//
//  FirstViewController.m
//  ProjectTest
//
//  Created by User on 2017/10/12.
//  Copyright © 2017年 User. All rights reserved.
//

#import "FirstViewController.h"
#import "SecondViewController.h"
#import <Masonry.h>

@interface FirstViewController ()

@end

@implementation FirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    // Do any additional setup after loading the view.
    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.view);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)firstPushAction:(id)sender {
    
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"pushToSecond"])
    {
        SecondViewController *secondVC = segue.destinationViewController;
        secondVC.sendString = self.FirstTextField.text;
    }
}

// 返回
- (IBAction)ViewController1UnwindSegue:(UIStoryboardSegue *)unwindSegue {
    if ([unwindSegue.identifier isEqualToString:@"backSegue"])
    {
        
    }
}

/// 反向传值
- (IBAction)dataComeBack:(UIStoryboardSegue *)segue
{
    NSLog(@"---%@",segue.identifier);
    if ([segue.identifier isEqualToString:@"dataComeBackSegue"])
    {
        SecondViewController *secondVC = segue.sourceViewController;
        self.FirstTextField.text = secondVC.comeBackString;
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
